#pragma once
#include "Socket.h"
#include "InetAddress.h"
#include <string>
class Acceptor{
private:
    Socket _sock;
    InetAddress _addr;
public:
    Acceptor(const std::string& ip,unsigned short port);
    ~Acceptor();
    void ready();
    int accept();
    int fd();//获取fd
private:
    //设置地址复用
    void setReuseAddr();
    //设置端口复用
    void setReusePort();
    void bind();
    void listen();


};